package intelligentcity.model;

import intelligentcity.model.intersection.Intersection;
import intelligentcity.model.streets.Street;

import java.util.List;
import java.util.Random;

public class City {
    
    private final static Random random = new Random();
    
    private final int leftBorderOfTraffic;
    private final int rightBorderOfTraffic;
    private final int upperBorderOfTraffic;
    private final int lowerBorderOfTraffic;

    private final List<Street> streets;
    private final List<Intersection> intersections;
    private final List<Point> startPoints;

    public City(List<Street> streets, List<Intersection> intersections, List<Point> startPoints, int leftB, int rightB,
            int upperB, int lowerB) {
        
        this.streets = streets;
        this.intersections = intersections;
        this.startPoints = startPoints;
        this.leftBorderOfTraffic = leftB;
        this.rightBorderOfTraffic = rightB;
        this.upperBorderOfTraffic = upperB;
        this.lowerBorderOfTraffic = lowerB;

    }

    public List<Street> getStreets() {
        return streets;
    }

    public List<Intersection> getIntersections() {
        return intersections;
    }

    public List<Point> getStartPoints() {
        return startPoints;
    }
    
    public Point getRandomStartPoint() {
        return new Point(startPoints.get(random.nextInt(startPoints.size())));
    }

    public int getLeftborderoftraffic() {
        return leftBorderOfTraffic;
    }

    public int getRightborderoftraffic() {
        return rightBorderOfTraffic;
    }

    public int getUpperborderoftraffic() {
        return upperBorderOfTraffic;
    }

    public int getLowerborderoftraffic() {
        return lowerBorderOfTraffic;
    }

}
